#include <cstdio>

int main( )
{
    int f[ 15 ] = { 0, 2, 7, 5, 30, 169, 441, 1872, 7632, 1740, 93313, 459901, 1358657, 2504881, 13482720 }, n;
    while ( scanf("%d", &n) && n )
        printf("%d\n", f[ n ]);
    return 0;
}
